# Archlive <http://archlive-pkg.googlecode.com>

pkgname=xournal
pkgver=0.4.5
pkgrel=9
pkgdesc="Notetaking and sketching application patched for inserting images."
arch=('i686' 'x86_64')
url="http://math.mit.edu/~auroux/software/xournal/"
license=('GPL')
depends=('libgnomecanvas>=2.30.1' 'ghostscript' 'shared-mime-info' 'poppler-glib>=0.14.0' 'hicolor-icon-theme' 'desktop-file-utils')
conflicts=('xournal')
install=xournal.install
source=("http://math.mit.edu/~auroux/software/xournal/xournal-${pkgver}.tar.gz" 'applypatch' 'xournal-0.4.5-sjg-image-rev7.patch')
md5sums=('795e4396ded2b67766eb2926be1fb4a9'
         '9db34a33094d9a670849462c03f44a29'
         '7eacd642f9d656e4c0e670d0c1b2335a')
sha1sums=('390cb275774469ed1b04b7268dd625bd456c895e'
          'bb08b81f37daad0abb592c73d94746f724ba71c7'
          'd2b547be65c59d94271a4f1a51b8b08c35f01156')
build() {

	cd "${srcdir}/xournal-${pkgver}"
	cp "${srcdir}/applypatch" .
	cp "${srcdir}/xournal-0.4.5-sjg-image-rev7.patch" .
	./applypatch xournal-0.4.5-sjg-image-rev7.patch
	./configure --prefix=/usr
	make
}
package() {
	cd "${srcdir}/xournal-${pkgver}"
	make DESTDIR="${pkgdir}" install desktop-install
	mkdir -p $pkgdir/usr/share/locale/zh_CN/LC_MESSAGES
	msgfmt $startdir/zh_CN.pot -o $pkgdir/usr/share/locale/zh_CN/LC_MESSAGES/xournal.mo
	cp -f $startdir/xournal.desktop $pkgdir/usr/share/applications/
}
